<template>
  <div>
    <h2>关键词采纳页面</h2>
    <el-row>
      <!-- 搜索框 -->
      <el-col :span="12" :offset="3" style="margin-bottom: 10px">
        <el-input placeholder="请输入关键词" v-model="input" clearable>
        </el-input>
      </el-col>
      <!-- 搜索按钮 -->
      <el-col :span="6" :offset="1">
        <el-button @click="handleSelect" type="primary">查询文章</el-button>
      </el-col>
    </el-row>
    <el-row>
      <!-- 搜索侧边栏 -->
      <el-col :span="0">
        <el-card>历史记录 </el-card>
      </el-col>
      <!-- 搜索内容 -->
      <el-col :span="23" :offset="1">

        <!-- 路由占位符 -->
        <router-view></router-view>

      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "AdvSearch",
  data() {
    return {
      input: "",
    };
  },
  methods: {
    handleSelect() {
      this.$router
        .push({
          path: "/advSearch",
          query: {
            term: this.input,
          },
        })
        .catch((error) => {
          console.log(error,"路由重复");
          alert("路由重复");
        });
    },
  },
};
</script>